
package com.ruoyi.web.controller.business;

import com.alipay.api.domain.GoodsInfo;
import com.ruoyi.business.domain.SysAppUser;
import com.ruoyi.business.service.ISysAppUserService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.pay.model.enums.PayWay;
import com.ruoyi.pay.model.req.ReqPayVO;
import com.ruoyi.pay.model.res.ResPayResultVO;
import com.ruoyi.pay.model.res.ResWechatPayResultVO;
import com.ruoyi.pay.service.PayFactory;
import com.ruoyi.pay.service.PayService;
import com.ruoyi.pay.util.RunningNumberUtil;
import com.ruoyi.system.service.ISysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author Larry
 * @date 2022/1/26 0026 15:55
 * @description
 */

@RestController
@RequestMapping("/pay")
@Api(tags = {"支付模块"})
public class PayController {
    @Autowired
    private PayFactory payFactory;
    @Autowired
    private ISysConfigService configService;
    @Autowired
    private ISysAppUserService userService;


    @GetMapping("/pay")
    @ApiOperation("预支付")
    public AjaxResult pay(Long goodsId) {

        ReqPayVO reqPayVO = new ReqPayVO();
        reqPayVO.setPayWay(PayWay.WECHAT_APPLET);
        //reqPayVO.setOrderId(orderInfoEntity.getOrderId().toString());
        reqPayVO.setSubject("订单");
        //reqPayVO.setOpenId(sysAppUser.getOpenid());
        //reqPayVO.setOpenId("ot3BM5akWaBKr-2103rBOs6AILhA");
        reqPayVO.setRunningNum(RunningNumberUtil.createRunningNumber());
        //reqPayVO.setPayMoney(byId.getPrice());
        //ResPayResultVO balance = payService.createBalance(reqPayVO);
        //ResWechatPayResultVO wechatAppletResult = balance.getWechatAppletResult();
        //return AjaxResult.success(wechatAppletResult);
        return  null;
    }





}

